
// #ifndef VUE3
import Vue from 'vue'
import App from './App'
import store from './store'
//配置网络请求
import { $http } from '@escook/request-miniprogram'
import '@/ulite'
Vue.config.productionTip = false
uni.$http = $http
//请求路径
$http.baseUrl = 'https://api-hmugo-web.itheima.net/api/public/v1'
App.mpType = 'app'
//请求之前做的事
$http.beforeRequest= function (options){
	uni.showLoading({
		title:'加载中'
	})
	const token = uni.getStorageSync('token')
	if(options.url.indexOf('/home/swiperdata') !== -1){
		if(token){
			options.header.token = token
		}
	}
},
Vue.filter('RMBformat', val => {
  return '￥' + Number(val).toFixed(2) + '元'
})
//得到响应之后做的事
$http.afterRequest = function(){
	uni.hideLoading()
}
const app = new Vue({
    ...App,
	store
})
app.$mount()
// #endif

// #ifdef VUE3
import { createSSRApp } from 'vue'
import App from './App.vue'
export function createApp() {
  const app = createSSRApp(App)
  return {
    app
  }
}
// #endif